package com.basic;


import com.frame.struts.BaseBean;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class CurrentDevelopForm extends BaseBean{
    public CurrentDevelopForm() {
    }

	CurrentDevelopEntity cd = new CurrentDevelopEntity();

	public String addCurrentDevelop() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		cd.setQyid(qyid);
		cd.setOptdate(new Date());
		cd.setOptrid(CommUtil.getUserId(request));
		try{
		if(factory.addCurrentDevelop(cd)){
			response.sendRedirect("/basic/queryCurrentDevelop.jsp");
			return "success";
		}
		response.sendRedirect("/basic/failed.jsp");
		}catch(Exception e){

		}

		return "failed";
	}

	public String modifyCurrentDevelop(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		cd.setQyid(qyid);
		cd.setOptdate(new Date());
		cd.setOptrid(CommUtil.getUserId(request));
		System.out.println("11111111");
		factory.deleteCurrentDevelop(cd.getId());
		try{
		if(factory.addCurrentDevelop(cd)){
			response.sendRedirect("/basic/queryCurrentDevelop.jsp");
			return "111";
		}
		response.sendRedirect("/basic/failed.jsp");
		}catch(Exception e){

		}

		return "f22";
	}


	/**
	 * @return cd. return cd.s the dz.
	 */
	public String getDz() {
		return cd.getDz();
	}
	/**
	 * @param dz The dz to set.
	 */
	public void setDz(String dz) {
		cd.setDz(dz);
	}
	/**
	 * @return cd. return cd.s the id.
	 */
	public int getId() {
		return cd.getId();
	}
	/**
	 * @param id The id to set.
	 */
	public void setId(int id) {
		cd.setId(id);
	}
	/**
	 * @return cd. return cd.s the jzmj.
	 */
	public double getJzmj() {
		return cd.getJzmj();
	}
	/**
	 * @param jzmj The jzmj to set.
	 */
	public void setJzmj(double jzmj) {
		cd.setJzmj(jzmj);
	}
	/**
	 * @return cd. return cd.s the mc.
	 */
	public String getMc() {
		return cd.getMc();
	}
	/**
	 * @param mc The mc to set.
	 */
	public void setMc(String mc) {
		cd.setMc(mc);
	}
	/**
	 * @return cd. return cd.s the optdate.
	 */
	public Date getOptdate() {
		return cd.getOptdate();
	}
	/**
	 * @param optdate The optdate to set.
	 */
	public void setOptdate(Date optdate) {
		cd.setOptdate(optdate);
	}
	/**
	 * @return cd. return cd.s the optrid.
	 */
	public String getOptrid() {
		return cd.getOptrid();
	}
	/**
	 * @param optrid The optrid to set.
	 */
	public void setOptrid(String optrid) {
		cd.setOptrid(optrid);
	}
	/**
	 * @return cd. return cd.s the qyid.
	 */
	public String getQyid() {
		return cd.getQyid();
	}
	/**
	 * @param qyid The qyid to set.
	 */
	public void setQyid(String qyid) {
		cd.setQyid(qyid);
	}
	/**
	 * @return cd. return cd.s the recstate.
	 */
	public String getRecstate() {
		return cd.getRecstate();
	}
	/**
	 * @param recstate The recstate to set.
	 */
	public void setRecstate(String recstate) {
		cd. setRecstate(recstate);
	}
	/**
	 * @return cd. return cd.s the remark.
	 */
	public String getRemark() {
		return cd.getRemark();
	}
	/**
	 * @param remark The remark to set.
	 */
	public void setRemark(String remark) {
		cd.setRemark(remark);
	}
	/**
	 * @return cd. return cd.s the yjzj.
	 */
	public double getYjzj() {
		return cd.getYjzj();
	}
	/**
	 * @param yjzj The yjzj to set.
	 */
	public void setYjzj(double yjzj) {
		cd.setYjzj(yjzj);
	}
	/**
	 * @return cd. return cd.s the yjzq.
	 */
	public String getYjzq() {
		return cd.getYjzq();
	}
	/**
	 * @param yjzq The yjzq to set.
	 */
	public void setYjzq(String yjzq) {
		cd.setYjzq(yjzq);
	}
	/**
	 * @return cd. return cd.s the ysje.
	 */
	public double getYsje() {
		return cd.getYsje();
	}
	/**
	 * @param ysje The ysje to set.
	 */
	public void setYsje(double ysje) {
		cd.setYsje(ysje);
	}
	/**
	 * @return cd. return cd.s the ysmj.
	 */
	public double getYsmj() {
		return cd.getYsmj();
	}
	/**
	 * @param ysmj The ysmj to set.
	 */
	public void setYsmj(double ysmj) {
		cd.setYsmj(ysmj);
	}
	/**
	 * @return cd. return cd.s the ysts.
	 */
	public double getYsts() {
		return cd.getYsts();
	}
	/**
	 * @param ysts The ysts to set.
	 */
	public void setYsts(double ysts) {
		cd.setYsts(ysts);
	}

}